#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <math.h>

int Sn(int n,int a)
{
	int sum = 0;
	int b = 0;
		for (int j = 0; j < n; ++j)
		{
			 b += a * pow(10, j);
			 sum += b;
		}
	return sum;
}


int main()
{
	printf("%d",Sn(5, 2));


	return 0;
}